﻿using System.ComponentModel.DataAnnotations.Schema;

namespace TuLing.Entities
{
    public class SaleOrderDetail 
    {
        public long Id { get; set; }
        public long SaleOrderId { get; set; }
        public long ProductId { get; set; }
        public int Quantity { get; set; }
        public decimal UnitPrice { get; set; }
        public DateTime CreatedAt { get; set; } = DateTime.Now;
        public string? Remark { get; set; }

        [NotMapped]
        public decimal TotalPrice => Quantity * UnitPrice;

        public virtual SaleOrder SaleOrder { get; set; }
        public virtual Product Product { get; set; }
    }
}